package com.ram.service.impl;

import com.ram.mapper.AccommodationFeeMapper;
import com.ram.pojo.AccommodationFee;
import com.ram.service.AccommodationFeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class AccommodationFeeServiceImpl implements AccommodationFeeService {
    @Autowired
    private AccommodationFeeMapper feeMapper;

    @Override
    public List<AccommodationFee> list() {
        return feeMapper.list();
    }

    @Override
    public AccommodationFee getById(Integer id) {
        return feeMapper.getById(id);
    }

    @Override
    public void add(AccommodationFee fee) {
        fee.setCreateTime(LocalDateTime.now());
        feeMapper.insert(fee);
    }

    @Override
    public void update(AccommodationFee fee) {
        feeMapper.update(fee);
    }

    @Override
    public void deleteById(Integer id) {
        feeMapper.deleteById(id);
    }
} 